#pragma once

typedef struct {
	wchar_t v[4];
	HBITMAP bmp;
	SIZE sz;

	void getSize(intptr_t i, CSize &szTime);
} stNumBitmap;

// CTimeDisplay
class CTimeDisplay : public CStatic
{
	DECLARE_DYNAMIC(CTimeDisplay)

public:
	CTimeDisplay();
	~CTimeDisplay() override;

protected:
	DECLARE_MESSAGE_MAP()
public:
	BOOL Create(CWnd *pParentWnd, UINT nID = 0xffff);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
protected:
	HDC hMemDC, hNumMemDC;
	HBITMAP hOldBitmap;
	intptr_t width, height;

	HDC CreateScrDC();
	void CreateMemBitmap(HDC hScrDC, intptr_t w, intptr_t h);
	void drawOut(const CRect &r, HBITMAP hBitmap);
	void CreateNum(HDC hScrDC, stNumBitmap *pNum, const CSize&sz);
	void drawNum(HDC hScrDC, stNumBitmap *pNum, const CPoint &pos, const CSize&sz);
	HBITMAP drawNA(HBITMAP hBitmap, COLORREF clr = RGB(255, 255, 255));
};
